﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt.ProjectOpening
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt.ProjectOpening;

    public class ProjectOpeningQDB_Map : ClassMapping<ProjectOpen_qdb>
    {
        public ProjectOpeningQDB_Map()
        {
            //映射ID
            Id(x => x.Id, map =>
            {
                map.Length(40);
                map.Column("rec_id");
            });

            Property(x => x.IsValid, map =>
            {
                map.Column("is_valid");
            });
            Property(x => x.CreateDate, map =>
            {
                map.Column("create_date");
            });

            //企业用户传真
            Property(x => x.EntUserFax, map =>
            {
                map.Column("ent_user_fax");
            });

            //企业用户移动电话
            Property(x => x.EntUserMobilephone, map =>
            {
                map.Column("ent_user_mobilephone");
            });

            //企业用户姓名
            Property(x => x.EntUserName, map =>
            {
                map.Column("ent_user");
            });

            //企业用户ID
            Property(x => x.EntUserID, map =>
            {
                map.Column("ent_user_id");
            });

            //企业用户桌面电话
            Property(x => x.EntUserTelephone, map =>
            {
                map.Column("ent_user_telephone");
            });

            //签到时间
            Property(x => x.QdDate, map =>
            {
                map.Column("qd_datetime");
            });

            Property(x => x.OrderFlag);

            //关联项目
            ManyToOne(x => x.Proj, map =>
            {
                map.Column("proj_id");
            });

            //关联投标人
            ManyToOne(x => x.Ent, map =>
            {
                map.Column("ent_id");
            });

            Bag(x => x.QdLabels, map =>
            {
                map.Key(km => km.Column("qd_id"));
            }, act => act.OneToMany());

            //
            Table("t_project_open_qdb");
        }
    }
}
